package com.junzhiit.nengji.cms.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.junzhiit.nengji.bo.ServeTechnicianBO;
import com.junzhiit.nengji.cms.service.ServeTechnicianService;
import com.junzhiit.nengji.cms.web.vo.ResultVO;
import com.junzhiit.nengji.cms.web.vo.SystemUserSessionVO;
import com.junzhiit.nengji.dao.ServeTechnicianDAO;
import com.junzhiit.nengji.dao.cache.SystemUserCacheDAO;
import com.junzhiit.nengji.dao.util.DIYKey;

@Service
public class ServeTechnicianServiceImpl extends BaseServiceImpl implements ServeTechnicianService{
	
	@Autowired
	private ServeTechnicianDAO serveTechnicianDAO;

	@Autowired
	private SystemUserCacheDAO systemUserCacheDAO;
	
	@Override
	public ResultVO findById(String sessionId,String technicianId) {
		ResultVO result = new ResultVO();
		SystemUserSessionVO systemUserSessionVO = systemUserCacheDAO.getHash(
				DIYKey.getSessionHashKey(sessionId),SystemUserSessionVO.class);
		ServeTechnicianBO serveTechnicianBO = new ServeTechnicianBO();
		serveTechnicianBO.setTechnicianId(technicianId);
		serveTechnicianBO.setShopId(systemUserSessionVO.getSystemId());
		List<ServeTechnicianBO> serveTechnician = serveTechnicianDAO.findById(serveTechnicianBO);
		result.setData(serveTechnician);
		
		return result;
	}

}
